<template>
  <div class="compitem">
    <div class="compname">{{title}}</div>
    <!-- <el-input style="width:150px;" v-model="value"></el-input> -->
    <el-select v-model="value" @change="change" style="width:200px;" placeholder="请选择">
    <el-option
      v-for="item in item"
      :key="item.id"
      :label="item.name"
      :value="item.id">
    </el-option>
  </el-select>
  </div>
</template>
<script>
export default {
  props:{
   title:{
     type:String
   },
   name:{
     type:String
   },
   val:{
     type:Number
   },
   item:{
     type:Array
   }
  },
  data() {
    return {
      value:''
    }
  },
  created() {
    this.value=this.val
  },
  methods: {
    change(){

    },
  },
  watch: {
    value:function(params) {
      // console.log(this)
      // console.log("xxxxxxx")
      this.$emit('func',{name:this.name,val:this.value})
    }
  },
}
</script>
<style lang="scss" scoped>
.compitem{
  .compname{
    font-size: 14px;
    // padding: 0 15px;
    // padding-right:15px;
    width: 90px;

  }
  width: 100%;
  display: flex;
   align-items: center;
}
</style>